title author date
Pandoc Reference Sheet Jonathan Corbett 14 March 2025

\begin

Pandoc Commands

Category Commands Description
Common Conversions pandoc input.md - o output.pdf
pandoc inpu.md - o output.pdf --pdf-engine=pdflatex
pandoc input.md -o output.docx
.html
Formatting Options pandoc input.md -o outpu.pdf --metadata titlle="DOCUMENT TITLE"
Advanced pandoc chapter1.md chapter2.md -o book.pdf # Combine to make a book
pandoc input.md --citeproc --bibliography=sources.bib -o output.pdf<brpandoc input.md -o output.pdf --template=custom.tex>

Advanced pandoc chapter1.md chapter2.md -o book.pdf
pandoc input.md --citeproc --bibliography=sources.bib -o output.pdf
pandoc input.md -o output.pdf -V fontsize=12pt
pandoc input.md -o output.pdf --toc
pandoc input.md -o output.html -c style.css

Pandoc Markdown Conversion Cheat Sheet

## Basic Commands PDF Generation
Basic Syntax PDF Output Options
pandoc input.md -o output.format pandoc input.md -o output.pdf
pandoc -f markdown -t html --pdf-engine=pdflatex
pandoc --list-input-formats --variable geometry:margin=1in
pandoc --list-output-formats --variable fontsize=12pt
--toc (add table of contents)
Common Output Formats --number-sections
-o output.html (HTML) --highlight-style=pygments
-o output.pdf (PDF)
-o output.docx (Word) LaTeX Template
-o output.pptx (PowerPoint) --template=template.tex
-o output.odt (OpenDocument) --variable mainfont="Liberation Serif"
-o output.epub (E-book) --include-in-header=header.tex
-o output.tex (LaTeX)

HTML Generation & PowerPoint & Science Features

HTML Options PowerPoint (PPTX) Creation
-s (standalone HTML with header) pandoc -t pptx input.md -o slides.pptx
--self-contained (embed assets) --slide-level=2 (heading level for slides)
--css=style.css # Title (title slide)
--mathml (MathML for equations) ## Slide Title (new slide)
--mathjax (MathJax for equations) :::::::::::::: {.columns} (column layout)
--include-in-header=file.html ::::: {.column width="40%"} (column start)
--include-before-body=file.html ::::: {.column width="60%"} (column start)
--include-after-body=file.html :::::::::::::: (end columns)
Table & Figure Options Science-Specific Features
![Caption](image.png) Math Equations
--resource-path=PATHS E=mc2E = mc^2 (inline math)
--extract-media=folder

E=mc2E = mc^2

(display math)
--wrap=auto none
--columns=NUMBER dydx\frac{dy}{dx} (fractions)
abf(x)dx\int_a^b f(x) dx (integrals)
Batch Processing Citations & Bibliography
----------------------------------- ----------------------------------------
Multiple File Conversion Citations
for f in *.md; do pandoc "f"o"f" -o "{f%.md}.pdf"; done --citeproc (citation processing)
--bibliography=bib.bib
Combining Files --csl=style.csl (citation style)
pandoc -s file1.md file2.md -o output.pdf [@citation-key] (in-text citation)
pandoc title.txt chapters/*.md -o book.pdf --- (YAML metadata block with bibliography)
Custom Formats Example Citation YAML
pandoc -o custom.docx --reference-doc=template.docx pandoc -t context input.md -o output.pdf
Science Teaching Tips Advanced Options
----------------------------------- ----------------------------------------
Code Blocks Filters & Extensions
python                          | `--filter=pandoc-citeproc` (legacy citations) print("Hello Science!")            | `--lua-filter=diagram.lua` (custom filters)                                 | --from markdown+tex_math_dollars+subscript
Copy


                                  | **Syntax Highlighting**
**Chemical Formulas**              | `--syntax-definition=lang.xml`
`$H_2O$` (subscript)               | `--highlight-style=pygments`
`$CO_2$` (carbon dioxide)          | `--no-highlight` (disable highlighting)
                                   |
**Lab Instructions**               | **Diagrams & Charts**
`> Note: Safety goggles required!` | Embed Mermaid: ` ```mermaid `
numbered lists for procedures      | Embed GraphViz: ` ```dot `
                                   | Embed PlantUML: ` ```plantuml `





<footer>
  <p><a href="index.html">Back to Home Page</a></p>
</footer>